<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新品有戏商家合作平台</title>
    <script src="__JS__/jquery.js"></script>
    <link href="__CSS__/boot.css" rel="stylesheet">
    <link href="__STATIC__/layui/css/layui.css" rel="stylesheet">
    <script src="__JS__/layer/layer.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script src="__STATIC__/boot/js/dropdown.js"></script>
</head>
<body>
{include file="base/header" /}
<div style="height: 5px"></div>
<div>
    <div style="width: 300px; float: left">
        <!--<div style="float: left;width: 100px;" >-->
            <!--<div class="dropdown">-->
                <!--<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">-->
                    <!--结算模式-->
                    <!--<span class="caret"></span>-->
                <!--</button>-->
                <!--<ul class="dropdown-menu" aria-labelledby="dropdownMenu2">-->
                    <!--<li><a href="#" onclick="before()">一件代发</a></li>-->
                    <!--<li><a href="#" >寄售</a></li>-->
                <!--</ul>-->
            <!--</div>-->
        <!--</div>-->
        <div >

            <button type="button" class="btn btn-primary " onclick="unprocessedorders()">查看未处理的订单</button>
        </div>
    </div>
</div>
<div style="float: right; margin-top: 5px;margin-bottom: 5px" class="box-title ">
    <form class="form-inline" action="{:url('business/postpayment/index')}" method="get">
        <input type="text" name="ordernumber" value="<?php if(isset($ordernumber)) echo $ordernumber ?>" class="form-control" id="exampleInputEmail3" >
        <input type="submit" class="btn btn-default" value="搜索"/>
        <input type="button" onclick="res()" value="全部显示" class="btn btn-default"/>
    </form>
</div>
<table class="layui-table" style="text-align: center">
    <thead>
    <tr>
        <td>订单号</td>
        <td>下单时间</td>
        <td>邮寄地址</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    {foreach $result as $val}
        <tr>
            <td>{$val.ordernumber}</td>
            <td>{$val.date}</td>
            <td>{$val.address}</td>
            <td>
                <button type="button" onclick="detail({$val.ordernumber})" class="btn btn-info btn-xs">详情</button>
            </td>
        </tr>
    {/foreach}
    </tbody>
</table>
{$result->render()}
</body>
<script>
    function before() {
        window.location.href = "{:url('business/index/index')}";
    }
    //详情
    function detail (ordernumber) {
        window.location.href = "{:url('business/postpayment/detail')}?ordernumber="+ordernumber;
    }
    //未处理订单
    function unprocessedorders() {
        window.location.href = "{:url('business/postpayment/index')}?status="+2;
    }
    //全部显示
    function res() {
        window.location.href = "{:url('business/postpayment/index')}";
    }
</script>
</html>